<template>



<div class="home-container">
        <p>这里是home组件</p>
        <button @click="sendMitt">$mitt发送数据</button>
        <About></About>
    </div>


</template>

<script>
//import  * from '' 
  
import { getCurrentInstance, ref, ComponentInternalInstance } from 'vue';
import About from '@/components/About.vue'
 
const { appContext } = getCurrentInstance() as ComponentInternalInstance;
const money = ref<number>(98);
 
const sendMitt = () => {
    appContext.config.globalProperties.$mitt.emit('moneyEvent', money.value += 2);
}
 

</script>
 
<style scoped>
  
</style>